package com.common.retrofit.method;

import com.common.cons.Constans;
import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.service.DuoBaoService;
import com.common.utils.SortUtils;

import rx.Observable;
import rx.Subscriber;

public class JingPaiJoinMethods extends BaseMethods {

    private static JingPaiJoinMethods m_ins = null;

    public static JingPaiJoinMethods getInstance() {
        if (m_ins == null) {
            synchronized (JingPaiJoinMethods.class) {
                if (m_ins == null) {
                    m_ins = new JingPaiJoinMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Api/Goods/";
    }

    private DuoBaoService initService() {
        return getRetrofit().create(DuoBaoService.class);
    }


    public void     buyAuction       (Subscriber<Object> subscriber,
                      int uid
            ,String hashid
            ,String gid
            ,String fvid
            ,String vid
    ) {
        String time  = System.currentTimeMillis()+"" ;
        Observable observable = initService().buyAuction(time,SortUtils.getMyHash("uid"+uid,"hashid"+hashid ,"time"+time
                ,"gid"+gid
                ,"fvid"+fvid
                ,"vid"+vid
        ),Constans.ANDROID_APP_ID,"3",uid,hashid,gid,fvid,vid);
        toSubscribe(observable, subscriber);
    }
}
